﻿@model FeedbackService.Models.Feedback

@{
    ViewBag.Title = "Оставить отзыв для " + Model.SiteUrl;
}

<h2>@ViewBag.Title</h2>

    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    
    @using (Html.BeginForm()) {
        @Html.ValidationSummary(true)
        <fieldset>
            <legend>Ваш отзыв</legend>

            @Html.HiddenFor(model => model.SiteId)
            @Html.HiddenFor(model => model.SiteUrl)
    
            <div class="editor-label">
                @Html.LabelFor(model => model.FeedbackTypeId)
            </div>
            <div class="editor-field">
                @Html.DropDownList("FeedbackTypeId",
                new SelectList( Model.AllFeedbackTypes.ToList(), "FeedbackTypeId", "TypeName", Model.FeedbackTypeId))
                @Html.ValidationMessageFor(model => model.FeedbackTypeId)
            </div>
    
            <div class="editor-label">
                @Html.LabelFor(model => model.Title)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Title)
                @Html.ValidationMessageFor(model => model.Title)
            </div>
    
            <div class="editor-label">
                @Html.LabelFor(model => model.Message)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Message)
                @Html.ValidationMessageFor(model => model.Message)
            </div>
    
            <p>
                <input type="submit" value="Создать" />
            </p>
        </fieldset>
    }
    
    <div>
        @Html.ActionLink("Все отзывы для этого сайта", "Details", "Site", new { id = Model.SiteId }, null)
    </div>
